"TEXT 2"="Block access to pages without PICS ratings"
"DESCRIPTION 1"="PICS, the Platform for Internet Content Selection, is a system of self rating where sites include a line of code in their meta tags to tell the browser what the page contains. If the page has content that the browser has been set to block (for example pornography, violence, swearing, abuse of illegal drugs, selling of firearms etc.), then the page will not be displayed."
"DESCRIPTION 2"="Option 1 will enable PICS filtering using default settings, and Option 2 will block access to any page that does not have a recognised PICS tag."
"DESCRIPTION 3"="NOTE #1: Whereas Internet Explorer has an established PICS system (introduced fully in IE4 and subsequent releases), the Mozilla implementation is not complete, so it should not be relied upon. If you need to filter your pages, it is recommended that you use a third party parental control program which may be more effective."
"DESCRIPTION 4"="NOTE #2: This will affect all users of Mozilla on this computer."
"DESCRIPTION 5"="Mozilla is free, open source web browser available from http://www.mozilla.org/ ."
"AUTHOR"="Xteq Systems (Neil R. Turner)"
"CONTACTURL"="http://www.xteq.com"
"COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
"COMMENT 1"="Rules of programming #46346: Never write plugins with a hangover."
' Neil's attempt at creating a Mozilla plug-in for X-Setup. As you can see, it's a little
' complicated due to the way Mozilla stores its settings (ie in a completely non-standard
' format... so much for a standards compliance, eh?), so that's why the code is slightly
' more sloppy then usual. But it works. I think.
'
' Feel free to copy code elements for use in other Mozilla/Netscape plugins.
sP="HKCU\Software\mozilla.org\Mozilla\"
sV1="CurrentVersion"
sV2="\Main\Install Directory"
Sub Plugin_Initialize
' To find out where the Mozilla keys are stored, we have to go get the version number.
MozVer=RegReadValue(sP&sV1)
if IsEmpty(MozVer)=true then
Call Disable()
else
' This tells us where Mozilla is installed, so that we can open the preferences files.
InsPath=RegReadValue(sP&MozVer&sV2)
end if
' Open all.js, which seems to be the main preference file.
Call TxtOpen(InsPath&"defaults\pref\all.js")
' Because we repeat a rather longwinded peace of code to get each setting, we use a SUB,
' and provide it with the name of the value and what we would expect it to say if it was
' on - for some reason Mozilla likes to put loads of spaces in, thus requiring more code.
' It makes it easier to read, but from an X-Setup point of view, it's annoying. Grrrrrrr.
i=InStr(s,",") ' We're only interested in the stuff after the comma, so we get rid of the left hand side.
s=Right(s,len(s)-i)
if s=Setting then ' If what we've retrieved is the same as what we were expecting, then we set the UI elephant to true.
Call SetUIElement(Num,true)
end if
else
' The prefs files may only be written on first launch or be corrupted, so if the item
' can't be found, we let the user know.
Call MsgWarning("X-Setup encountered an error while trying to retrieve the settings. This may be because you have not run Mozilla yet, or the preferences are corrupted. Please run Mozilla, or reinstall it.")
Call Disable()
end if
End Sub
Sub Plugin_Apply(ElementIndex,ElementSubIndex)
' Yup, we need this again... Though since the plugin would already be disabled if it